import request from "@/utils/request.ts";
import {Condition, ReturnData} from "@/api/types/contacts.ts";


//获取所有通讯录信息
export const allUserContacts = () => {
    return request<ReturnData>({
        url: '/api/contacts/get/all',
        method: 'GET'
    })
}

//根据名字获取通讯录信息
export const searchContactsByName = (name: string) => {
    return request<ReturnData>({
        url: '/api/contacts/get/name',
        method: 'GET',
        params: {
            name : name
        }
    })
}

export const searchContactsByCondition = (condition: Condition) => {
    return request<ReturnData>({
        url: '/api/contacts/get/condition',
        method: 'GET',
        params: {
            ...condition
        }
    })
}


